package com.hhsjtest.testjenkins;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ((TextView)findViewById(R.id.app_name)).setText(getString(R.string.app_name_new));

        findViewById(R.id.jump_must).setOnClickListener(v -> {
            try {
                startActivity(new Intent("ACTION_MUST"));
            } catch (Exception e){
                Toast.makeText(this,"不支持MUST模块",Toast.LENGTH_SHORT).show();
            }
        });

        findViewById(R.id.jump_a).setOnClickListener(v -> {

            try {
                startActivity(new Intent("ACTION_A"));
            } catch (Exception e){
                Toast.makeText(this,"不支持A模块",Toast.LENGTH_SHORT).show();
            }
        });

        findViewById(R.id.jump_b).setOnClickListener(v -> {
            try {
                startActivity(new Intent("ACTION_B"));
            } catch (Exception e){
                Toast.makeText(this,"不支持B模块",Toast.LENGTH_SHORT).show();
            }

        });

        findViewById(R.id.jump_c).setOnClickListener(v -> {
            try {
                startActivity(new Intent("ACTION_C"));
            } catch (Exception e){
                Toast.makeText(this,"不支持C模块",Toast.LENGTH_SHORT).show();
            }

        });

    }
}
